<html>

<head>
    
   
</head>

<body>

    <table border="1">
        <tr id="tr1">
            <th>Firstname</th>
            <th>Lastname</th>
        </tr>
        <tr id="tr2">
            <td>Peter</td>
            <td>Griffin</td>
        </tr>
    </table>
    <br />

    <input type="button" onclick="getInnerHTML()" value="Alert innerHTML of table row" />
    <script type="text/javascript">
        function getInnerHTML() {
            // alert(document.getElementById("tr1").innerHTML);
            console.log(document.getElementById("tr1").innerHTML);
            console.log(document.getElementById("tr1"));
        }
        getInnerHTML();
    </script>

</body>

</html>